package com.jluzh10.learning.domain;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.jluzh10.learning.domain.jsonserializer.CustomDateSerializer;

import java.util.Date;

public class Reply {
    private Integer id;

    private Integer answerId;

    private String content;

    private Integer userId;

    private Integer aimId;

    private Date createTime;

    private Byte state;

    /*冗余属性*/
    private User user;

    private User aimUser;//回复的目标用户

    public User getAimUser() {
        return aimUser;
    }

    public void setAimUser(User aimUser) {
        this.aimUser = aimUser;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @Override
    public String toString() {
        return "Reply{" +
                "id=" + id +
                ", answerId=" + answerId +
                ", content='" + content + '\'' +
                ", userId=" + userId +
                ", aimId=" + aimId +
                ", createTime=" + createTime +
                ", state=" + state +
                ", user=" + user +
                ", aimUser=" + aimUser +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getAnswerId() {
        return answerId;
    }

    public void setAnswerId(Integer answerId) {
        this.answerId = answerId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content == null ? null : content.trim();
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getAimId() {
        return aimId;
    }

    public void setAimId(Integer aimId) {
        this.aimId = aimId;
    }

    @JsonSerialize(using = CustomDateSerializer.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Byte getState() {
        return state;
    }

    public void setState(Byte state) {
        this.state = state;
    }
}